from django.shortcuts import render

# Create your views here.
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import Teacher
from .sers import *


class TeacherView(APIView):
    def get(self, request):
        teacher = Teacher.objects.all()
        ser = TeacherSer(teacher, many=True)
        return Response({'code': 200, 'message': '成功', 'data': ser.data})
